<template>
  出库管理列表
	<div style="padding:20px 20px;" >
		<el-card class="xiu_box">
			<el-table  v-loading="loading" :data="tableData"　 stripe style="width:100%; margin-top:20px;">
				  <el-table-column header-align='center' align='center' label="类型" >
				  	<template slot-scope="scope">{{id_name(scope.row.typeId,$store.state.user.leidata)}}</template>
				  </el-table-column>
          <el-table-column header-align='center' align='center' prop="goodsSku"  label="物料编码" show-overflow-tooltip></el-table-column>
          <el-table-column header-align='center' align='center' prop="goodsName"  label="物品名称" ></el-table-column>
          <el-table-column header-align='center' align='center' label="状态" >
            <template slot-scope="scope">
              {{scope.row.isDone == false?'待出库':''}}
            </template>
          </el-table-column>
          <el-table-column header-align='center' align='center' prop="createdTime"  label="创建时间" ></el-table-column>
		  <el-table-column header-align='center' align='center' prop="amount" label="申请数量" ></el-table-column>
		  <el-table-column header-align='center' align='center' prop="price" label="单价" >
				<template slot-scope="scope">{{scope.row.price}} ￥</template>
		  </el-table-column>
		  <el-table-column header-align='center' align='center' prop="remarks" label="备注" show-overflow-tooltip></el-table-column>
          <el-table-column header-align='center' align='center' prop="purpose" label="申请原因" show-overflow-tooltip></el-table-column>
          <el-table-column header-align='center' align='center' prop="username" label="申请人" ></el-table-column>
		  <el-table-column header-align='center' align='center' prop="depName" label="部门" ></el-table-column>
          <el-table-column header-align='center' align='center' width="170" label="操作">
          	<template slot-scope="scope">
          		 <el-button class='btn' @click="xamine(scope.row)" type="warning">审核</el-button>
          	</template>
          </el-table-column>
			</el-table>
			分页
			<el-pagination v-show="totals>sizec" style='margin-top:35px;width:100%;text-align: center;' :page-size="sizec" :total="totals" :page-sizes="ye_s"
			   background @size-change="handleSizeChange" @current-change="handleCurrentChange"layout="total, sizes, prev, pager, next, jumper">
			</el-pagination>
		</el-card>
	  <stockchu ref="ss" :active="isActive" :datas="deli_data"></stockchu>
	</div>
</template>

<script>
  import {examine,delStock} from '@/api_bast/stock.js'
  import stockchu from '@/components/MES/stock/stockchu.vue'
	export default {
		name: '',
		data(){
			return{
        deli_data:{
          goodsSku:'', //物料编码
          isDone: '', //状态
          price: '', //单价
					remarks: '', //备注
					purpose: "", //申请理由
          username: '' ,//申请人
          goodsName: '',//物品名称
          model: '',//物品型号
          size: '',//尺寸
          typeId: '',//类型
          provider: '',//供应商
          id: ''
        },
        isActive: false,
        page: 1,
        sizec: 15,
        ye_s: [15,20],
        // names: '',//查询条件
        loading:false,
        totals: 0, //总条数
        tableData: [] //返回数据
			}
		},
		components:{
      stockchu
		},
    methods:{
      hidn(){//关闭审核
        this.$refs.ss.active = false
      },
      get_data(){//获取数据
        let dat = {
          // name:this.names,
          pageNo:this.page,
          pageSize:this.sizec
        }
        this.loading=true;
        examine(dat).then(res => {
          this.loading = false;
          this.totals = res.resData.applyTask.total;
          this.tableData = res.resData.applyTask.list;
        })
        },
        handleSizeChange(val){//每页条数改变时触发
          this.sizec = val;
          this.get_data();
        },
        handleCurrentChange(val){//当前页改变时触发
          this.page = val
          this.get_data();
        },
        xamine(i){//审核
            this.$refs.ss.qf()
            this.deli_data = i
        }
    },
    mounted() {
      this.get_data()
    }
	}
</script>

<style scoped="scoped">

</style>
